package com.huawei.appgallery.appcomment.ui.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appgallery.appcomment.impl.bean.AppInfoBean;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean.AppCommentInfo;
import com.huawei.appgallery.appcomment.ui.AppReportActivity;
import com.huawei.appgallery.appcomment.ui.view.FoldTextView.e;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.ui.framework.activity.AbstractBaseActivity;
import huawei.widget.HwTextView;
import java.io.Serializable;
import java.util.Locale;
import o.azb;
import o.bcb;
import o.bcg;
import o.bcg.f;
import o.bcg.h;
import o.bcg.i;
import o.bcw;
import o.bcz;
import o.bdm;
import o.bdo;
import o.bdq;
import o.bdr;
import o.bdt;
import o.bdu;
import o.bdz;
import o.beg;
import o.bei;
import o.bek;
import o.ber;
import o.bmt;
import o.cdh;
import o.cdo;
import o.cea;
import o.cfw;
import o.cgy;
import o.cks;
import o.ckt;
import o.cku;
import o.ckv;
import o.cvt;
import o.dof;
import o.epv;

public class CommentItemView extends LinearLayout implements OnClickListener, OnMenuItemClickListener, bdz, e, com.huawei.appgallery.appcomment.ui.view.FoldTextView.b {
    private HwTextView ʻ;
    private String ʻॱ;
    private DissImageView ʼ;
    private TextView ʼॱ;
    private HwTextView ʽ;
    private HwTextView ʽॱ;
    private HwTextView ʾ;
    private View ʿ;
    private RatingBar ˈ;
    private boolean ˉ;
    private View ˊ;
    private ImageView ˊˋ;
    private TextView ˊॱ;
    private View ˊᐝ;
    public View ˋ;
    private bdt ˋˊ;
    private ImageView ˋॱ;
    private final Context ˎ;
    private View ˏ;
    private PopupMenu ˏॱ;
    private AppCommentInfo ͺ;
    private View ॱ;
    private TextView ॱˊ;
    private TextView ॱˋ;
    private TextView ॱˎ;
    private ApproveImageView ॱॱ;
    private FoldTextView ॱᐝ;
    private ImageView ᐝ;
    private HwTextView ᐝॱ;

    class a implements bdz {
        final /* synthetic */ CommentItemView ˊ;

        private a(CommentItemView commentItemView) {
            this.ˊ = commentItemView;
        }

        public void ˊ() {
            this.ˊ.ˋˊ.ˏ(this.ˊ.ͺ, this.ˊ.ˎ);
        }

        public void ˋ() {
        }
    }

    class b implements bdz {
        final /* synthetic */ CommentItemView ˊ;

        private b(CommentItemView commentItemView) {
            this.ˊ = commentItemView;
        }

        public void ˊ() {
            this.ˊ.ॱ(this.ˊ.ͺ.ॱ());
        }

        public void ˋ() {
        }
    }

    class c implements bdz {
        final /* synthetic */ CommentItemView ˊ;

        private c(CommentItemView commentItemView) {
            this.ˊ = commentItemView;
        }

        public void ˊ() {
            if (this.ˊ.ͺ.ˏॱ() == 1) {
                this.ˊ.ʼ.setDissed(false);
            } else {
                this.ˊ.ʼ.setDissed(true);
            }
            this.ˊ.ˋˊ.ॱ(this.ˊ.ͺ);
        }

        public void ˋ() {
        }
    }

    class d implements bdz {
        final /* synthetic */ CommentItemView ॱ;

        private d(CommentItemView commentItemView) {
            this.ॱ = commentItemView;
        }

        public void ˊ() {
            if (this.ॱ.ͺ != null) {
                Serializable o_beg = new beg();
                o_beg.ˎ(this.ॱ.ͺ.ˎ());
                o_beg.ˋ(this.ॱ.ͺ.ͺ());
                o_beg.ˋ(10);
                o_beg.ॱ(this.ॱ.ͺ.ˏ());
                o_beg.ˏ(this.ॱ.ͺ.ʼ());
                o_beg.ˊ(this.ॱ.ͺ.ॱ());
                Intent intent = new Intent(this.ॱ.ˎ, AppReportActivity.class);
                Bundle bundle = new Bundle();
                bundle.putSerializable("reportContentInfo", o_beg);
                intent.putExtras(bundle);
                this.ॱ.ˎ.startActivity(intent);
            }
        }

        public void ˋ() {
        }
    }

    public CommentItemView(Context context, boolean z) {
        this(context, null);
        this.ˉ = z;
    }

    public CommentItemView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.ˏ = null;
        this.ॱ = null;
        this.ˊ = null;
        this.ॱॱ = null;
        this.ʼ = null;
        this.ʻ = null;
        this.ʽ = null;
        this.ˏॱ = null;
        this.ˋॱ = null;
        this.ˊॱ = null;
        this.ॱˊ = null;
        this.ʻॱ = null;
        this.ॱˎ = null;
        this.ॱˋ = null;
        this.ॱᐝ = null;
        this.ˈ = null;
        this.ʼॱ = null;
        this.ʽॱ = null;
        this.ʿ = null;
        this.ˉ = false;
        this.ˎ = context;
        View inflate = ((LayoutInflater) context.getSystemService("layout_inflater")).inflate(o.bcg.d.ˏ, this, true);
        azb.ˏ(inflate);
        this.ˏ = inflate.findViewById(bcg.e.ˈॱ);
        this.ॱ = inflate.findViewById(bcg.e.ॱˑ);
        this.ˊ = inflate.findViewById(bcg.e.ˌॱ);
        this.ˋ = inflate.findViewById(bcg.e.ˊᐝ);
        this.ˋॱ = (ImageView) inflate.findViewById(bcg.e.ॱㆍ);
        this.ˊॱ = (TextView) inflate.findViewById(bcg.e.ॱﹳ);
        this.ॱˊ = (TextView) inflate.findViewById(bcg.e.ॱᐧ);
        this.ॱˎ = (TextView) inflate.findViewById(bcg.e.ॱᐨ);
        this.ॱˋ = (TextView) inflate.findViewById(bcg.e.ॱـ);
        this.ॱᐝ = (FoldTextView) inflate.findViewById(bcg.e.ˋʻ);
        this.ᐝॱ = (HwTextView) inflate.findViewById(bcg.e.ﾟॱ);
        ber.ˎ(inflate.findViewById(bcg.e.ॱˎ));
        this.ˈ = (RatingBar) inflate.findViewById(bcg.e.ॱˉ);
        this.ʼॱ = (TextView) inflate.findViewById(bcg.e.ॱꜟ);
        this.ʻ = (HwTextView) inflate.findViewById(bcg.e.ʿॱ);
        this.ʽ = (HwTextView) inflate.findViewById(bcg.e.ˎͺ);
        this.ॱॱ = (ApproveImageView) inflate.findViewById(bcg.e.ˊʻ);
        this.ʼ = (DissImageView) inflate.findViewById(bcg.e.ˏͺ);
        this.ʿ = inflate.findViewById(bcg.e.י);
        this.ʽॱ = (HwTextView) inflate.findViewById(bcg.e.ॱˈ);
        this.ᐝ = (ImageView) inflate.findViewById(bcg.e.ॱʾ);
        this.ˊˋ = (ImageView) inflate.findViewById(bcg.e.ʼˋ);
        ber.ˎ(this.ˊˋ);
        this.ˊᐝ = inflate.findViewById(bcg.e.ˉॱ);
        this.ॱᐝ.setOnMaxLineListener(this, this.ᐝॱ);
        this.ॱᐝ.setOnContentChangedListener(this, this.ᐝॱ);
        this.ᐝॱ.setOnClickListener(this);
        this.ˊᐝ.setOnClickListener(new ckt(this));
        this.ˏ.setOnClickListener(this);
        this.ॱ.setOnClickListener(this);
        this.ˊ.setOnClickListener(new ckt(this));
        findViewById(bcg.e.ॱˎ).setOnClickListener(new ckt(this));
        findViewById(bcg.e.ॱꓸ).setOnClickListener(new ckt(this));
        this.ʿ.findViewById(bcg.e.ߴ).setOnClickListener(new ckt(this));
        LayoutParams layoutParams = (LayoutParams) this.ˊˋ.getLayoutParams();
        layoutParams.height = 0;
        this.ˊˋ.setLayoutParams(layoutParams);
        this.ˋˊ = new bdt(context);
    }

    public AppCommentInfo ˏ() {
        return this.ͺ;
    }

    public void setCommentInfo(AppCommentInfo appCommentInfo) {
        this.ͺ = appCommentInfo;
    }

    public void setReplyLayout(boolean z) {
        this.ˉ = z;
    }

    public void onClick(View view) {
        if (this.ͺ != null) {
            if (!bmt.ˊ(this.ˎ)) {
                ckv.ˎ(this.ˎ.getString(h.ᐝʽ), 0);
            } else if (view == this.ˏ) {
                new bdr((Activity) this.ॱॱ.getContext(), this).ˊ();
            } else if (view == this.ˊᐝ || view.getId() == bcg.e.ॱˍ || view.getId() == bcg.e.ߴ) {
                ˎ();
            } else if (view == this.ॱ) {
                new bdr((Activity) this.ˎ, new c()).ˎ();
            } else if (view == this.ˊ) {
                ॱ();
            } else if (view == this.ᐝॱ) {
                this.ॱᐝ.ॱ();
                this.ͺ.ˋ(this.ॱᐝ.ˏ());
            } else if ((view.getId() == bcg.e.ॱˎ || view.getId() == bcg.e.ॱꓸ) && !this.ˉ) {
                ˎ();
            }
        }
    }

    private void ॱ() {
        this.ˏॱ = new PopupMenu(getContext(), this.ˊ);
        Menu menu = this.ˏॱ.getMenu();
        this.ˏॱ.getMenuInflater().inflate(i.ˊ, menu);
        MenuItem findItem = menu.findItem(bcg.e.ㆍ);
        MenuItem findItem2 = menu.findItem(bcg.e.ʽʼ);
        MenuItem findItem3 = menu.findItem(bcg.e.ʽˊ);
        CharSequence string = getContext().getResources().getString(h.ˊॱ);
        if (this.ͺ.ˊ().equals(UserSession.getInstance().getUserId())) {
            findItem.setVisible(false);
            findItem2.setVisible(false);
            findItem3.setVisible(true);
        } else {
            findItem3.setVisible(false);
            if (this.ͺ.ʽॱ() == 1) {
                string = getContext().getResources().getString(h.ͺ);
            }
            findItem.setTitle(string);
            findItem2.setTitle(getContext().getResources().getString(h.ʻˋ));
            findItem.setVisible(true);
            findItem2.setVisible(true);
        }
        this.ˏॱ.setOnMenuItemClickListener(this);
        this.ˏॱ.show();
    }

    public void ॱ(bdm.e eVar) {
        try {
            if (eVar.ॱ().equals(this.ͺ.ॱ())) {
                bdo.ˎ(eVar, this.ͺ);
                if (this.ͺ.ˋॱ() == 1) {
                    this.ॱॱ.setApproved(true);
                } else {
                    this.ॱॱ.setApproved(false);
                }
                if (this.ͺ.ˏॱ() == 1) {
                    this.ʼ.setDissed(true);
                } else {
                    this.ʼ.setDissed(false);
                }
                ˋ(this.ʽ, this.ͺ.ॱˋ(), this.ˎ.getString(h.ᐝˊ));
                ˋ(this.ʻ, this.ͺ.ॱˊ(), this.ˎ.getString(h.ㆍ));
                ॱ(this.ॱॱ, this.ͺ.ॱˊ(), this.ˎ.getString(h.ㆍ));
                ॱ(this.ʼ, this.ͺ.ॱˋ(), this.ˎ.getString(h.ᐝˊ));
            }
        } catch (Throwable e) {
            bcb.ˋ.ˊ("CommentItemView", "update error", e);
        }
    }

    public void ˎ(bdm.e eVar) {
        try {
            if (eVar.ॱ().equals(this.ͺ.ॱ())) {
                bdo.ˋ(eVar, this.ͺ);
                if (this.ͺ.ˋॱ() == 1) {
                    this.ॱॱ.setApproved(true);
                } else {
                    this.ॱॱ.setApproved(false);
                }
                CharSequence string = this.ˎ.getString(h.ㆍ);
                if (this.ͺ.ॱˊ() != 0) {
                    this.ʻ.setText(cgy.ˎ((double) this.ͺ.ॱˊ()));
                } else {
                    this.ʻ.setText(string);
                }
                ॱ(this.ॱॱ, this.ͺ.ॱˊ(), string);
            }
        } catch (Throwable e) {
            bcb.ˋ.ˊ("CommentItemView", "updateApprove error", e);
        }
    }

    private void ˎ() {
        new bdr((Activity) this.ˎ, new a()).ˎ();
    }

    public void ˋ(AppCommentInfo appCommentInfo, AppInfoBean appInfoBean, boolean z) {
        int i;
        if (appInfoBean != null) {
            appCommentInfo.ˋ(appInfoBean.ˎ());
        }
        setCommentInfo(appCommentInfo);
        if (appCommentInfo.ˊᐝ()) {
            this.ˊˋ.setVisibility(8);
        } else {
            LayoutParams layoutParams = (LayoutParams) this.ˊˋ.getLayoutParams();
            int dimension = (int) this.ˎ.getResources().getDimension(o.bcg.b.ͺ);
            layoutParams.setMarginStart(cdo.ˏ(this.ˎ, 72));
            layoutParams.setMarginEnd(dimension);
            ˋ(this.ˊˋ, z);
        }
        ˏ(appCommentInfo.ˏ());
        this.ˋॱ.setOnClickListener(new ckt(new bek.e(appCommentInfo.ˊ())));
        View view = this.ˋ;
        if (appCommentInfo.ॱॱ() == 6) {
            i = 0;
        } else {
            i = 8;
        }
        view.setVisibility(i);
        if (1 == appCommentInfo.ʾ()) {
            this.ʻॱ = this.ˎ.getResources().getString(h.ﾟ);
        } else if (2 == appCommentInfo.ʾ()) {
            this.ʻॱ = this.ˎ.getResources().getString(h.ᐝˋ);
        } else {
            this.ʻॱ = "";
        }
        this.ˊॱ.setText(appCommentInfo.ˎ());
        ॱ(this.ॱˊ, this.ʻॱ);
        ॱ(this.ॱˎ, appCommentInfo.ˋ());
        ˋ(appCommentInfo.ͺ(), appCommentInfo.ʿ());
        ॱ(this.ॱˋ, bei.ॱ(getContext(), appCommentInfo.ʻ()));
        float f = 0.0f;
        try {
            f = Float.parseFloat(appCommentInfo.ʼ());
        } catch (NumberFormatException e) {
            bcb.ˋ.ˏ("", "rating value NumberFormatException, rating:" + appCommentInfo.ʼ());
        }
        this.ˈ.setRating(f);
        String str = null;
        if (appInfoBean != null && !TextUtils.isEmpty(appInfoBean.ˏ()) && appInfoBean.ˏ().equals(appCommentInfo.ॱᐝ())) {
            str = this.ˎ.getString(h.ʽॱ);
        } else if (!TextUtils.isEmpty(appCommentInfo.ॱᐝ())) {
            str = String.format(Locale.ENGLISH, this.ˎ.getString(h.ॱﹳ), new Object[]{appCommentInfo.ॱᐝ()});
        }
        ॱ(this.ʼॱ, str);
        ˏ(appCommentInfo);
        ˋ(this.ʽ, appCommentInfo.ॱˋ(), this.ˎ.getString(h.ᐝˊ));
        ˋ(this.ʻ, appCommentInfo.ॱˊ(), this.ˎ.getString(h.ㆍ));
        ˋ(this.ʽॱ, appCommentInfo.ॱˎ(), this.ˎ.getString(h.ˎͺ));
        ॱ(this.ॱॱ, appCommentInfo.ॱˊ(), this.ˎ.getString(h.ㆍ));
        ॱ(this.ʼ, appCommentInfo.ॱˋ(), this.ˎ.getString(h.ᐝˊ));
        ॱ(this.ᐝ, appCommentInfo.ॱˎ(), this.ˎ.getString(h.ˎͺ));
        ॱ(appCommentInfo);
    }

    private void ˏ(AppCommentInfo appCommentInfo) {
        if (appCommentInfo.ˋॱ() == 1) {
            this.ॱॱ.setApproved(true);
        } else {
            this.ॱॱ.setApproved(false);
        }
        if (appCommentInfo.ˏॱ() == 1) {
            this.ʼ.setDissed(true);
        } else {
            this.ʼ.setDissed(false);
        }
    }

    private void ॱ(ImageView imageView, int i, String str) {
        if (i != 0) {
            imageView.setContentDescription(str);
        } else {
            imageView.setContentDescription(null);
        }
    }

    private void ˏ(String str) {
        if (TextUtils.isEmpty(str)) {
            this.ˋॱ.setImageResource(o.bcg.c.ᐝॱ);
            this.ˋॱ.setTag("");
        } else if (!str.equals((String) this.ˋॱ.getTag())) {
            this.ˋॱ.setTag(str);
            cea.ˏ(this.ˋॱ, str, "head_default_icon");
        }
    }

    private void ॱ(AppCommentInfo appCommentInfo) {
        if (appCommentInfo.ᐝॱ() != null) {
            String string;
            this.ʿ.setVisibility(0);
            this.ʿ.setOnClickListener(new ckt(this));
            if (appCommentInfo.ˊᐝ()) {
                ViewGroup.LayoutParams layoutParams = new LayoutParams(-1, -2);
                layoutParams.setMarginStart(0);
                layoutParams.setMarginEnd(0);
                this.ˊˋ.setLayoutParams(layoutParams);
                this.ˊˋ.setVisibility(0);
            } else {
                this.ˊˋ.setVisibility(8);
            }
            TextView textView = (TextView) this.ʿ.findViewById(bcg.e.ٴ);
            TextView textView2 = (TextView) this.ʿ.findViewById(bcg.e.ـॱ);
            ImageView imageView = (ImageView) this.ʿ.findViewById(bcg.e.ʻʼ);
            TextView textView3 = (TextView) this.ʿ.findViewById(bcg.e.ՙ);
            this.ʾ = (HwTextView) this.ʿ.findViewById(bcg.e.ߴ);
            TextView textView4 = (TextView) this.ʿ.findViewById(bcg.e.ॱˍ);
            textView4.setOnClickListener(new ckt(this));
            ber.ˎ(this.ʿ);
            ॱ(this.ʾ, appCommentInfo.ᐝॱ().ʼ());
            ॱ(textView3, appCommentInfo.ᐝॱ().ͺ());
            ॱ(textView4, appCommentInfo.ॱˎ());
            if (TextUtils.isEmpty(appCommentInfo.ᐝॱ().ͺ())) {
                imageView.setVisibility(8);
            } else {
                imageView.setVisibility(0);
            }
            if (1 == appCommentInfo.ᐝॱ().ॱॱ()) {
                string = this.ˎ.getResources().getString(h.ﾟ);
            } else if (2 == appCommentInfo.ᐝॱ().ॱॱ()) {
                string = this.ˎ.getResources().getString(h.ᐝˋ);
            } else {
                string = "";
            }
            ˏ(textView, textView2, textView3, appCommentInfo, string);
            textView.setText(appCommentInfo.ᐝॱ().ˎ());
            ॱ(textView2, string);
            if (!TextUtils.isEmpty(string)) {
                textView.requestLayout();
            }
            ʽ();
            return;
        }
        this.ʿ.setVisibility(8);
    }

    private void ˏ(TextView textView, TextView textView2, TextView textView3, AppCommentInfo appCommentInfo, String str) {
        int i = 0;
        int ˋ = ˋ(textView, appCommentInfo.ᐝॱ().ˎ());
        int ˋ2 = ˋ(textView3, appCommentInfo.ᐝॱ().ͺ());
        int ˋ3 = ˋ(textView2, str) + epv.ˋ(this.ˎ, 18);
        if (dof.ॱ(str)) {
            ˋ3 = 0;
        }
        int ˋ4 = epv.ˋ(this.ˎ, 20);
        if (!dof.ॱ(appCommentInfo.ᐝॱ().ͺ())) {
            i = ˋ4;
        }
        int ॱ = (((azb.ॱ(this.ˎ) - azb.ˊ(this.ˎ)) - azb.ˏ(this.ˎ)) - this.ˎ.getResources().getDimensionPixelSize(o.bcg.b.ʽ)) - (this.ˎ.getResources().getDimensionPixelSize(o.bcg.b.ʻ) * 3);
        if (((ˋ + ˋ2) + ˋ3) + i > ॱ) {
            textView.setMaxWidth(((ॱ - (ˋ2 < epv.ˋ(this.ˎ, 42) ? ˋ2 : epv.ˋ(this.ˎ, 42))) - ˋ3) - i);
        }
    }

    private int ˋ(TextView textView, String str) {
        TextPaint paint = textView.getPaint();
        if (dof.ॱ(str)) {
            str = "";
        }
        return (int) paint.measureText(str);
    }

    private void ʽ() {
        if (this.ˊᐝ.getWidth() == 0) {
            this.ˊᐝ.post(new Runnable(this) {
                final /* synthetic */ CommentItemView ˊ;

                {
                    this.ˊ = r1;
                }

                public void run() {
                    this.ˊ.ʽ();
                }
            });
            return;
        }
        ImageView imageView = (ImageView) this.ʿ.findViewById(bcg.e.ꜞॱ);
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) imageView.getLayoutParams();
        this.ˊᐝ.measure(0, 0);
        layoutParams.setMarginEnd((int) ((((float) this.ˊᐝ.getMeasuredWidth()) / 2.0f) - (this.ʿ.getContext().getResources().getDimension(o.bcg.b.ˊ) / 2.0f)));
        layoutParams.setMarginStart(0);
        layoutParams.width = -1;
        layoutParams.height = -2;
        imageView.setLayoutParams(layoutParams);
    }

    private void ˋ(ImageView imageView, boolean z) {
        if (z) {
            imageView.setVisibility(8);
        } else {
            imageView.setVisibility(0);
        }
    }

    private void ॱ(TextView textView, String str) {
        if (TextUtils.isEmpty(str)) {
            textView.setVisibility(8);
            return;
        }
        textView.setVisibility(0);
        textView.setText(str);
    }

    private void ˋ(String str, boolean z) {
        if (TextUtils.isEmpty(str)) {
            this.ॱᐝ.setVisibility(8);
            return;
        }
        this.ॱᐝ.setVisibility(0);
        if (z) {
            this.ᐝॱ.setText(getContext().getString(h.ॱꜞ));
        } else {
            this.ᐝॱ.setText(getContext().getString(h.ॱﾞ));
        }
        this.ॱᐝ.setContent(new SpannableStringBuilder(str), z, ber.ॱ(this.ॱᐝ));
    }

    private void ॱ(TextView textView, int i) {
        if (i == 0 || 1 == i) {
            textView.setVisibility(8);
            return;
        }
        textView.setVisibility(0);
        textView.setText(getResources().getQuantityString(f.ˎ, i, new Object[]{Integer.valueOf(i)}));
    }

    private void ˋ(HwTextView hwTextView, int i, String str) {
        if (i > 0) {
            hwTextView.setVisibility(0);
            hwTextView.setText(cgy.ˎ((double) i));
            return;
        }
        if (!ber.ˊ(hwTextView.getContext())) {
            hwTextView.setMaxWidth(cdo.ˏ(hwTextView.getContext(), 42));
        }
        hwTextView.setAutoTextInfo(hwTextView.getContext().getResources().getDimensionPixelSize(o.bcg.b.ˎ), hwTextView.getContext().getResources().getDimensionPixelSize(o.bcg.b.ˋ), 0);
        hwTextView.setVisibility(0);
        hwTextView.setText(str);
    }

    public boolean onMenuItemClick(MenuItem menuItem) {
        if (menuItem.getItemId() == bcg.e.ㆍ) {
            new bdr((Activity) this.ˎ, new b()).ˎ();
        } else if (menuItem.getItemId() == bcg.e.ʽʼ) {
            new bdr((Activity) this.ˎ, new d()).ˎ();
        } else if (menuItem.getItemId() == bcg.e.ʽˊ) {
            ˊ(this.ͺ.ॱ(), this.ͺ.ॱᐝ(), this.ͺ.ʽ());
        }
        return false;
    }

    private void ˎ(String str, String str2, String str3) {
        Context ʻॱ = AbstractBaseActivity.ʻॱ();
        if (ʻॱ == null) {
            bcb.ˋ.ˋ("DetailCommentItemView", "current Activity is null");
        } else if (bmt.ˊ(ʻॱ)) {
            cvt o_bcz = new bcz(str);
            o_bcz.setServiceType_(cdh.ˎ(ʻॱ));
            cfw.ˎ(o_bcz, new bdu(str, str2, str3, ʻॱ));
        } else {
            ckv.ˎ(ʻॱ.getString(h.ᐝʽ), 0);
        }
    }

    private void ˊ(final String str, final String str2, final String str3) {
        CharSequence string = this.ˎ.getResources().getString(h.ᐧ);
        cku ˋ = cku.ˋ(null, this.ˎ.getResources().getString(h.ꞌ));
        ˋ.ˎ(getContext());
        ˋ.ॱ(-1, string);
        ˋ.ॱ(new cks(this) {
            final /* synthetic */ CommentItemView ˎ;

            public void enableNetworking() {
                this.ˎ.ˎ(str, str2, str3);
            }

            public void upgrade() {
            }

            public void ˋ() {
            }
        });
    }

    public void setDissImageContentDescription(int i) {
        if (i != 0) {
            this.ʼ.setContentDescription(this.ˎ.getString(h.ᐝˊ));
        } else {
            this.ʼ.setContentDescription(null);
        }
    }

    public void setApproveImageContentDescription(int i) {
        if (i != 0) {
            this.ॱॱ.setContentDescription(this.ˎ.getString(h.ㆍ));
        } else {
            this.ॱॱ.setContentDescription(null);
        }
    }

    private void ॱ(String str) {
        if (bmt.ˊ(this.ˎ)) {
            int ʽॱ = this.ͺ.ʽॱ();
            cvt o_bcw = new bcw(str, ʽॱ);
            o_bcw.setServiceType_(cdh.ˎ((Activity) this.ˎ));
            cfw.ˎ(o_bcw, new bdq(this.ͺ, str, ʽॱ, this.ˎ));
            return;
        }
        ckv.ˎ(this.ˎ.getString(h.ᐝʽ), 0);
    }

    public void ˊ() {
        this.ˋˊ.ˋ(this.ͺ);
    }

    public void ˋ() {
    }

    public void ˊ(boolean z, HwTextView hwTextView) {
        if (hwTextView == null) {
            return;
        }
        if (z) {
            hwTextView.setText(getContext().getString(h.ॱꜞ));
        } else {
            hwTextView.setText(getContext().getString(h.ॱﾞ));
        }
    }

    public void ॱ(boolean z, HwTextView hwTextView) {
        if (hwTextView == null) {
            return;
        }
        if (z) {
            hwTextView.setVisibility(0);
        } else {
            hwTextView.setVisibility(8);
        }
    }
}
